/*
 * @description:
 * @version:
 * @Author: 王治飞
 * @Date: 2023-08-17 14:52:36
 * @LastEditors: 王治飞
 * @LastEditTime: 2023-08-17 14:52:36
 */
function styleStrToObject(styleStr) {
  const obj = {}
  const s = styleStr
    .toLowerCase()
    .replace(/-(.)/g, function (m, g) {
      return g.toUpperCase()
    })
    .replace(/;\s?$/g, '')
    .split(/:|;/g)
  for (var i = 0; i < s.length; i += 2) {
    obj[s[i].replace(/\s/g, '')] = s[i + 1].replace(/^\s+|\s+$/g, '')
  }

  return obj
}

export default styleStrToObject
